<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath %>" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>农资与农产品全程供应链物流平台-车辆信息</title>
<meta name="kewywords" content="农资与农产品全程供应链物流平台"/>
<meta name="description" content="农资与农产品全程供应链物流平台"/>
<link href="css/style.css" type="text/css" rel="stylesheet"/>
<link rel="icon" href="js/dialog/favicon.ico" type="image/x-icon"/>
<script type="text/javascript" src="js/jquery-1.9.1.js"></script>
<script type="text/javascript" src="js/dialog/lhgdialog.js?skin=default"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			$("#vehicleInfoTb tr:odd").addClass("odd");	
			$("#vehicleInfoTb tr:even").addClass("even");			
		});
		function editCheck(){
			var selected_value = [];    
			$("input[name='ids']:checked").each(function(){    
			 	selected_value.push($(this).val());    
			});    
			if(selected_value.length == 0) {
				$.dialog.alert("你还没有选择任何内容"); 
				return false;
			} else if(selected_value.length > 1){
				$.dialog.alert("一次只能修改一条记录！"); 
				return false;
			}
			var id = selected_value[0];
			$("#editVehicleId").val(id);
			$("#editVehicle").submit();
		}
		function deleteCheck(){
			var selected_value = [];    
			$("input[name='ids']:checked").each(function(){    
			 	selected_value.push($(this).val());    
			});    
			if(selected_value.length == 0) {
				$.dialog.alert("你还没有选择任何内容"); 
				return false;
			}
			$.dialog.confirm("确定要删除吗？", 
		    	function(){			    	
					var id = selected_value;
					document.getElementById("deleteVehicleIds").value=id;
					$("#deleteVehicle").submit();
				}, function(){}
			); 			
		}
		
	</script>
</head>
<body>
<%@include file="top.jsp" %>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
	    <td width="187" height="37" bgcolor="#e0e0e0" class="brt bbt">
	    	<div class="topleft fl">系统菜单栏</div>
	    </td>
	    <td bgcolor="#e7e7e7" class=" bbt">
		    <div class="topleft fl">您现在的位置：<a href="#">首页</a>&nbsp;>&nbsp;<span>车辆信息</span>
		    </div>
	    </td>
	</tr>
	<tr>
	    <td width="187" height="100%" valign="top" bgcolor="#FFFFFF" class="brt">
	    	<div class="left_bk">
				<div class="menu2">
					<%@include file="database_left.jsp" %>
		        </div>
	        </div>
		</td>
    	<td align="left" valign="top" bgcolor="#FFFFFF">
	    	<div class="content">
				<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
			        <tr>
				        <td height="38" style="background:url(images/zz_tit.jpg) left top repeat-x;">
					        <div class="tt_back fl">车辆列表信息</div>
					        <div class="fr"><img src="images/tit_right.jpg" alt="" width="103" height="38" />
					        </div>
				        </td>
			        </tr>
		        	<tr>
						<td class="borders btn">
						<table width="100%" border="0" cellspacing="0" cellpadding="0">
						  <tr>
						    <td height="41" bgcolor="#fffeee" style="border-bottom:#fee7bd solid 1px;">
							    <form action="queryVehicle" method="post">	
							    <table width="890" border="0" cellspacing="0" cellpadding="0" align="left">
									<tr>
									<td width="100" align="right">车辆编号：</td>
								    <td width="100">
								    	<input type="text" name="vehicle.vehicleNo" class="input_are w122" />
								    </td>
									<td width="100" align="right">车牌号码：</td>
								    <td width="100">
								    	<input type="text" name="vehicle.licensePlateNo" class="input_are w122" />
								    </td>
								    <td width="100" align="right">车辆类型：</td>
								    <td width="100">
									    <select class="input_are w87" name="vehicle.vehicleType">
											<option value="">请选择</option>
											<option value="普通货车">普通货车</option>
											<option value="箱式货车">箱式货车</option>
											<option value="封闭货车">封闭货车</option>
											<option value="平板货车">平板货车</option>
											<option value="集装厢车">集装厢车</option>
									    </select>
								    </td>
								    <td width="100" align="right">车辆状态：</td>
								    <td width="100">
								    <select class="input_are w87" name="vehicle.state" >
								    	<option value="">请选择</option>
										<option value="空闲">空闲</option>
										<option value="出车">出车</option>
										<option value="维修">维修</option>
								    </select></td>
								    
								    <td width="100">
								    	<input type="image" type="submit" src="images/cx.jpg" />
								    </td>
									</tr>
								</table>
								</form>
							</td>
						  </tr>
						  <tr>
						    <td align="center">
							    <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
								    <tr align="left">
								        <td height="42" colspan="2">
									        <input type="button" id="addBt" style="cursor: pointer;" class="buttons2" value="新  增"
									        	onClick="location.href='addVehicle'"/>
									        <input type="button" id="editBt" class="buttons2" style="cursor: pointer;" value="修  改" 
									        	onClick="editCheck()" />  
									        <input type="button" class="buttons2" id="deleteBt" value="删  除" style="cursor: pointer;" 
												onClick="deleteCheck()" />  
											<form id = "editVehicle" action="editVehicle" method="post">
											<input type="hidden" id="editVehicleId" name = "editVehicleId" value="0" />								
											</form>		
											<form id="deleteVehicle" action="deleteVehicle" method="post" >
												<input type="hidden" id="deleteVehicleIds" name="deleteVehicleIds" value=""/>
											</form>      
								        </td>
								        
									</tr>
								      
									<tr>
										<td colspan="2">
										<div style="height:300px">
									        <table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#e3e3e3">
										        <tr class="captit">
										            <td width="4%" height="31" align="center" valign="middle">
										            	<input type="checkbox" class="checks" /></td>
										             <td width="10%" height="31" align="center" valign="middle">车辆编号</td>
										            <td width="10%" height="31" align="center" valign="middle">车牌号码</td>
										            <td width="10%" height="31" align="center" valign="middle">道路运输证</td>
										            <td width="9%" height="31" align="center" valign="middle">车辆类型</td>
										            <td width="8%" height="31" align="center" valign="middle">车辆吨位(t)</td>
										            <td width="7%" height="31" align="center" valign="middle">车长(m)</td>
										            <td width="7%" height="31" align="center" valign="middle">车宽(m)</td>
										            <td width="7%" height="31" align="center" valign="middle">车高(m)</td>
										            <td width="7%" height="31" align="center" valign="middle">车辆状态</td>										            										            
										            <td width="10%" height="31" align="center" valign="middle">购入日期</td>
										            <td width="10%" height="31" align="center" valign="middle">登记人</td>
												</tr>
												<s:iterator value="vehicleList" id="vehicle" >
												<tr height="26" bgcolor="#efefef">
										            <td height="26" align="center" valign="middle" bgcolor="#FFFFFF">
										            	<input type="checkbox" name="ids" value="<s:property value='#vehicle.vehicleNo'/>" /></td>
										            <td height="26" align="center" valign="middle" bgcolor="#FFFFFF">
										            	<s:property value="#vehicle.vehicleNo"/></td>
										            <td height="26" align="center" valign="middle" bgcolor="#FFFFFF">
										            	<s:property value="#vehicle.licensePlateNo"/></td>
										            <td height="26" align="center" valign="middle" bgcolor="#FFFFFF">
										            	<s:property value="#vehicle.roadTransportNo"/></td>
										            <td height="26" align="center" valign="middle" bgcolor="#FFFFFF">
										            	<s:property value="#vehicle.vehicleType"/></td>
										            <td height="26" align="center" valign="middle" bgcolor="#FFFFFF">
										            	<s:property value="#vehicle.vehicleTonnage"/></td>
										            <td height="26" align="center" valign="middle" bgcolor="#FFFFFF">
										            	<s:property value="#vehicle.length"/></td>
										            <td height="26" align="center" valign="middle" bgcolor="#FFFFFF">
										            	<s:property value="#vehicle.width"/></td>
										            <td height="26" align="center" valign="middle" bgcolor="#FFFFFF">
										            	<s:property value="#vehicle.height"/></td>
										             <td height="26" align="center" valign="middle" bgcolor="#FFFFFF" class="wordblue">
										            	<s:property value="#vehicle.state"/></td>
										            <td height="26" align="center" valign="middle" bgcolor="#FFFFFF" class="wordblue">
										            	<s:date name="#vehicle.intakeDate" format="yyyy-MM-dd" /></td>
										            <td height="26" align="center" valign="middle" bgcolor="#FFFFFF" class="wordblue">
										            	<s:property value="#vehicle.registrant"/></td>
												</tr>
												</s:iterator>
									        </table>
									    </div> 
								        </td>
									</tr>
									<tr>
								        <td width="30%" height="50"> </td>
								        <td width="70%">
											<table width="700" border="0" align="right" cellpadding="0" cellspacing="0">
												<tr>
													<td width="100%" >${pager.paginationModel}</td>
												</tr>
											</table>
										</td>
									</tr>									
							    </table>
						    </td>
						  </tr>
						</table>
						</td>
		        	</tr>
				</table>
			</div>
		</td>
  </tr>
</table>
<div class="bottom">版权所有：安徽朗坤物联网</div>
</body>
</html>